package com.yhy.client;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * describe:处理数据
 *
 * @author helloworldyu
 * @date 2018/5/8
 */
public class ServerHandler extends SimpleChannelInboundHandler<String> {

	@Override
	protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
		System.out.println("收到数据:"+msg);
	}

	@Override
	public void exceptionCaught(ChannelHandlerContext ctx,
	                            Throwable cause) {
		cause.printStackTrace();
		ctx.close();
	}

}